package cn.shadow.module.chess.message.chnChess.frame;

import cn.shadow.module.chess.message.chnChess.Camp;
import cn.shadow.module.chess.message.chnChess.ChessType;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.scenes.scene2d.ui.Image;

public class ChessActor extends Image {
    private ChessType chessType;
    private Camp camp;
    TextureRegion region;
    public ChessActor(ChessType chessType, Camp camp, TextureRegion region) {
        super(region);
    }

    @Override
    public void act(float delta) {
        super.act(delta);
    }

    @Override
    public void draw(Batch batch, float parentAlpha) {
        super.draw(batch, parentAlpha);
        // 如果 region 为 null 或者 演员不可见, 则直接不绘制
        if (region == null || !isVisible()) {
            return;
        }
        batch.draw(
                region,
                getX(), getY(),
                getOriginX(), getOriginY(),
                getWidth(), getHeight(),
                getScaleX(), getScaleY(),
                getRotation()
        );
    }
}
